<!DOCTYPE html>
<html class="x-admin-sm">
<head>
    <meta charset="UTF-8">
    <title>房间管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
        content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" href="/web/res/css/xadmin.css">
    <script src="/web/res/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/web/res/js/xadmin.js"></script>
    <script type="text/javascript" src="/web/res/js/common.js"></script>
</head>

<body>
    <div class="x-nav">
        <span class="layui-breadcrumb">
            <a href="">首页</a>
            <a href="">用户管理</a>
            <a><cite>1v1主播审核</cite></a>
        </span>
        <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
        onclick="location.reload()" title="刷新">
        <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
    </div>
    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-body ">
                        <!--查询条件
                        搜索参数 loginname ，nick，userId-->
                        <form class="layui-form layui-col-space5" type="post" id="room"  action="/manage/app/liveapply/page">
                            <div class="layui-input-inline layui-show-xs-block">
                                <input type="text" name="userId"  value="${userId!''}"  placeholder="请输入用户ID" autocomplete="off" class="layui-input">
                            </div>
                            <div class="layui-input-inline layui-show-xs-block">
                                <input type="text" name="nick"  value="${nick!''}"  placeholder="请输入用户昵称" autocomplete="off" class="layui-input">
                            </div>
                            <div class="layui-input-inline layui-show-xs-block">
                                <input type="text" name="loginname"  value="${loginname!''}"  placeholder="请输入用户账户" autocomplete="off" class="layui-input">
                            </div>
                            <div class="layui-input-inline layui-show-xs-block">
                                <input class="layui-input" placeholder="开始时间" value="${startDate!''}" name="startDate" id="startdate">
                            </div>
                            <div class="layui-input-inline layui-show-xs-block">
                                <input class="layui-input" placeholder="截止时间" value="${endDate!''}" name="endDate" id="enddate">
                            </div>
                            <div class="layui-input-inline layui-show-xs-block">
                                <button class="layui-btn"  lay-submit lay-filter="search" >
                                    <i class="layui-icon">&#xe615;</i>搜索
                                </button>
                            </div>
                        </form>
                        <!-- <button class="layui-btn " onclick="xadmin.open('添加','/manage/app/task/gotoAdd')" >
                            <i class="layui-icon layui-icon-add-1"></i>添加
                        </button> -->
                    </div>
                    <div class="layui-card-body" style="overflow:auto">
                        <table class="layui-table layui-tables layui-form tableH"  style="min-width: 100% !important; "  lay-size="sm"  id="tab">
                            <thead>
                                <tr>
                                    <th>用户ID</th>
                                    <th>用户昵称</th>
                                    <th>用户账号</th>
                                    <th>视频审核</th>
                                    <th>声音审核</th>
                                    <th>创建时间</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                            <#if list?? && (list?size > 0) >
                            <#list list as task>
                                <tr>
                                    <td>${(task.userId)!''}</td>
                                    <td>${(task.nick)!''}</td>
                                    <td>${(task.loginname)!''}</td>
                                    <td>
                                        <button class="layui-btn layui-btn-xs layui-btn-cheng"
                                        onclick="xadmin.open('查看审核视频','/manage/app/liveapply/info?id=${(task.id?c)!''}',900,700)">
                                        <i class="layui-icon"></i>查看审核视频
                                        </button>
                                    </td>
                                    <td>
                                        <input type="hidden" id="sount" name="sount" required lay-verify="required" autocomplete="off"
                                        class="layui-input" value="${(task.sount)!''}"/>
                                        <audio controls="controls">
                                            <source src="${(task.sount)!''}" type="audio/ogg">
                                            <source src="${(task.sount)!''}" type="audio/mpeg">
                                            <embed height="100" width="100" src="" />
                                        </audio>

                                    </td>
                                    <td>${task.createtime?string("yyyy-MM-dd HH:mm:ss")!}</td>
                                    <td class="td-manage btn-center">
                                        <button class="layui-btn layui-btn-xs layui-btn-warm" onclick="audit(this,'${(task.id?c)!''}',2)">
                                            <i class="layui-icon layui-icon-edit"></i>审核通过
                                        </button>
                                        <button class="layui-btn layui-btn-xs layui-btn-danger" onclick="audit(this,'${(task.id?c)!''}',3)">
                                            <i class="layui-icon layui-icon-edit"></i>拒绝通过
                                        </button>
                                    </td>
                                </tr>
                            </#list>
                            <#else>
                                <tr>
                                    <td colspan="10" style="text-align: center;">暂无记录</td>
                                </tr>
                            </#if>
                            </tbody>
                        </table>
                    </div>
                    <!-- 分页条 -->
                    <div id="pager" style="text-align: center;"></div>
                </div>
            </div>
        </div>
    </div>
</body>
<script src="voice-2.0.js"></script>
<script src="audio.min.js"></script>
<script>
    // 初始化两个插件
    // audiojs.events.ready(function () {
    //     var as = audiojs.createAll();
    // });
    // RongIMLib.RongIMVoice.init();
    // console.log('${(task.sount)!''}');
    
    // function get_voices() {
    //     $.ajax({
    //         url: 'url', // 请求后台，后台把amr文件进行base64编码后直接返回
    //         dataType: 'text', // 注意：因为是返回base64字符串，所以要用‘text’类型
    //         success: function (res) {
    //             RongIMLib.RongIMVoice.play(res) // 同样道理，直接播放该base64字符串
    //         },
    //         error: function (res) {
    //             console.log(res)
    //         }
    //     })
    // }

</script>
<script>
    layui.use(['laydate', 'form', 'table'], function () {
        let $ = layui.$;
        var laydate = layui.laydate;
        var form = layui.form;
        var table = layui.table;
        var carousel = layui.carousel;
        //执行一个laydate实例
        laydate.render({
            elem: '#startdate' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
            elem: '#enddate' //指定元素
        });

        $(".img_biges").click(function(){
            var url = $(this).attr('title');
            var xbcmz =url.split(',');
            $.each(xbcmz, function (index, item) {
                showimg(item)
            })
        });


    });
    // 删除
    function audit(obj, id,type) {
        console.log(obj, id,type)
        layui.use('layer',function () {
            let $ = layui.$;
            layer.confirm(type==2?'确认要审核通过吗？':'确认要拒绝审核吗？', function (index) {
                ajaxPost($,"/manage/app/liveapply/update",{'id':id,'status':type},function (data) {
                    if (data.code == 0) {
                        layer.msg(data.msg, {icon: 1, time: 1000}, function(){
                            location.reload();
                        });
                    } else {
                        layer.msg(data.msg, {icon: 2, time: 1000}, function(){
                        });
                    }
                });
            });
        });
    }

</script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
    layui.use(['laypage', 'layer', 'form'], function(){
        let $ = layui.$;
        var laypage = layui.laypage
            ,form = layui.form
            ,layer = layui.layer;

        laypage.render({
            elem: 'pager'
            ,count: ${(splitPage.totalCount?c)!''}
            ,limit: ${(splitPage.pageSize?c)!''}
            ,curr: ${(splitPage.pageIndex?c)!''}
            ,layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip']
            ,jump: function(obj, first){
                //首次不执行
                if(!first){
                    var myform = document.forms[0];
                    // alert("formName:"+myform.id,${(splitPage.totalCount?c)!''},${(splitPage.pageSize?c)!''},${(splitPage.pageIndex?c)!''});
                    var pageIndex = document.createElement("input");
                    pageIndex.name="pageIndex";
                    pageIndex.type="hidden";
                    pageIndex.value=obj.curr;
                    myform.appendChild(pageIndex);

                    var pageSize = document.createElement("input");
                    pageSize.name="pageSize";
                    pageSize.type="hidden";
                    pageSize.value=obj.limit;
                    myform.appendChild(pageSize);
                    $("button[lay-submit]:eq(0)").click();
                }
            }
        });
    });
</script>


</html>